package com.twu.biblioteca;

import java.util.concurrent.ConcurrentHashMap;

public class BibliotecaApp {

    public static void main(String[] args) {

        String book1Title = "Head First Java";
        String book1Author = "Kathy Sierra & Bert Bates";
        int book1Year = 2005;

        String book2Title = "Test-Driven Development";
        String book2Author = "Kent Beck";
        int book2Year = 2003;

        String book3Title = "Long Walk To Freedom";
        String book3Author = "Nelson Mandela";
        int book3Year = 1994;

        String movie1Title = "Skyfall";
        int movie1Year = 2012;
        String movie1Director = "Sam Mendes";
        int movie1Rating = 8;

        String movie2Title = "The Bridge On The River Kwai";
        int movie2Year = 1957;
        String movie2Director = "David Lean";
        // no movie rating

        String userCustomerNumber = "123-4567";
        String userPassword = "myPassword";
        String userName = "Rob";
        String userEmailAddress = "myEmail@email.com";
        String userPhoneNumber = "02088520000";

        System.out.println(new WelcomeMessage());

        ConcurrentHashMap<String, Book> books = new ConcurrentHashMap<String, Book>();
        books.put(book1Title, new Book(book1Title, book1Author, book1Year));
        books.put(book2Title, new Book(book2Title, book2Author, book2Year));
        books.put(book3Title, new Book(book3Title, book3Author, book3Year));

        ConcurrentHashMap<String, Movie> movies = new ConcurrentHashMap<String, Movie>();
        movies.put(movie1Title, new Movie(movie1Title,movie1Year,movie1Director,movie1Rating));
        movies.put(movie2Title, new Movie(movie2Title,movie2Year,movie2Director));

        Library library = new Library(books, movies);
        library.addUser(new User(userCustomerNumber, userPassword, userName, userEmailAddress, userPhoneNumber));

        MainMenu menu = new MainMenu(library);
        menu.displayMenu();
        menu.getUserChoice();
    }
}
